import asyncio
import sys
from pathlib import Path

# 添加项目根目录到 Python 路径
project_root = Path(__file__).parent.parent
sys.path.append(str(project_root))

from src.collectors.eastmoney import EastMoneyCollector
from src.utils.logger import get_logger

logger = get_logger(__name__)

async def main():
    """运行爬虫"""
    try:
        collector = EastMoneyCollector()
        await collector.collect()
        logger.info("Crawler completed successfully")
    except Exception as e:
        logger.error(f"Crawler failed: {e}")

if __name__ == "__main__":
    asyncio.run(main()) 